package com.hankol.community.bean;

import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import android.widget.TextView;

import com.hankol.community.databinding.ActivityPulpitVideoBinding;

/**
 * @author: 关忆北、
 * @date: 2022/4/29
 * @Des：
 */
public class HKVideoBean {

    private boolean isReStar;//播放完成，是否重新播放
    private ProgressBar pBar;//加载视频 loading
    private ImageView ivPlayState; //视频暂停/播放按钮
    private SeekBar sBar;//视频底部进度条
    private ImageView ivCover;//视频封面
    private TextView tvCurrentSpeed;//视频实时进度
    private TextView tvTotalSpeed;//视频总进度
    private ImageView ivFullScreen;//视频全屏
    private RelativeLayout rlVideoFatherView;
    private String videoUrl;
    private int second;//相隔几秒上报
    private long offset;//视频播放进度 毫秒
    public ActivityPulpitVideoBinding binding;//视频播放进度 毫秒

    public boolean isReStar() {
        return isReStar;
    }

    public ProgressBar getPBar() {
        return pBar;
    }

    public ImageView getIvPlayState() {
        return ivPlayState;
    }

    public SeekBar getSBar() {
        return sBar;
    }

    public ImageView getIvCover() {
        return ivCover;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public TextView getTvCurrentSpeed() {
        return tvCurrentSpeed;
    }

    public TextView getTvTotalSpeed() {
        return tvTotalSpeed;
    }

    public ImageView getIvFullScreen() {
        return ivFullScreen;
    }

    public RelativeLayout getRlVideoFatherView() {
        return rlVideoFatherView;
    }

    public long getOffset() {
        return offset;
    }

    public int getSecond() {
        return second;
    }

    public ActivityPulpitVideoBinding getBinding() {
        return binding;
    }

    public void setBinding(ActivityPulpitVideoBinding binding) {
        this.binding = binding;
    }

    public HKVideoBean(HKVideoBuilder builder) {
        this.isReStar = builder.isReStar;
        this.pBar = builder.pBar;
        this.ivPlayState = builder.ivPlayState;
        this.sBar = builder.sBar;
        this.ivCover = builder.ivCover;
        this.videoUrl = builder.videoUrl;
        this.tvTotalSpeed = builder.tvTotalSpeed;
        this.ivFullScreen = builder.ivFullScreen;
        this.tvCurrentSpeed = builder.tvCurrentSpeed;
        this.rlVideoFatherView = builder.rlVideoFatherView;
        this.second = builder.second;
        this.offset = builder.offset;
        this.binding = builder.binding;
    }

    public static class HKVideoBuilder {
        private boolean isReStar;//播放完成，是否重新播放
        private ProgressBar pBar;//加载视频 loading
        private ImageView ivPlayState; //视频暂停/播放按钮
        private SeekBar sBar;//视频底部进度条
        private ImageView ivCover;//视频封面
        private String videoUrl;
        private TextView tvCurrentSpeed;//视频实时进度
        private TextView tvTotalSpeed;//视频总进度
        private ImageView ivFullScreen;//视频全屏
        private RelativeLayout rlVideoFatherView;
        private int second = 5;//相隔几秒上报，默认5秒
        private long offset = 0;
        private ActivityPulpitVideoBinding binding;

        public HKVideoBuilder setReStar(boolean reStar) {
            isReStar = reStar;
            return this;
        }

        public HKVideoBuilder setPBar(ProgressBar pBar) {
            this.pBar = pBar;
            return this;
        }

        public HKVideoBuilder setBinding(ActivityPulpitVideoBinding binding) {
            this.binding = binding;
            return this;
        }

        public ActivityPulpitVideoBinding getBinding() {
            return binding;
        }

        public HKVideoBuilder setIvPlayState(ImageView ivPlayState) {
            this.ivPlayState = ivPlayState;
            return this;
        }

        public HKVideoBuilder setSBar(SeekBar sBar) {
            this.sBar = sBar;
            return this;
        }

        public HKVideoBuilder setIvCover(ImageView ivCover) {
            this.ivCover = ivCover;
            return this;
        }

        public HKVideoBuilder setVideoUrl(String videoUrl) {
            this.videoUrl = videoUrl;
            return this;
        }

        public HKVideoBuilder setTvCurrentSpeed(TextView tvCurrentSpeed) {
            this.tvCurrentSpeed = tvCurrentSpeed;
            return this;
        }

        public HKVideoBuilder setTvTotalSpeed(TextView tvTotalSpeed) {
            this.tvTotalSpeed = tvTotalSpeed;
            return this;
        }

        public HKVideoBuilder setIvFullScreen(ImageView ivFullScreen) {
            this.ivFullScreen = ivFullScreen;
            return this;
        }

        public HKVideoBuilder setRlVideoFatherView(RelativeLayout rlVideoFatherView) {
            this.rlVideoFatherView = rlVideoFatherView;
            return this;
        }

        public HKVideoBuilder setSecond(int second) {
            this.second = second;
            return this;
        }

        public HKVideoBuilder setOffset(long offset) {
            this.offset = offset;
            return this;
        }

        public HKVideoBean builder() {
            return new HKVideoBean(this);
        }

    }


}
